<?php
$this->activemenu = 22;
$this->pageTitle=Yii::app()->name . ' - Gửi câu hỏi';
$this->breadcrumbs=array(
		'Hỏi đáp'=>array('default/page', 'alias'=>'hoi-dap'),
		'Gửi câu hỏi'
);
?>
<div class="detail-page">
<div class="head-tool">
	<div class="main-title">Gửi câu hỏi</div>
</div>
<div class="content-box">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'sendAsk-form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
			'validateOnSubmit'=>true,
	),
	));
?>
<?php echo $form->error($askForm,'avatar'); ?>
<?php echo $form->error($askForm,'email'); ?>
<?php echo $form->error($askForm,'title'); ?>
<?php echo $form->error($askForm,'content'); ?>
<table cellpadding="5">
	<tr>
		<td><label>Nhập họ tên</label></td>
		<td>
			<?php echo $form->textField($askForm,'avatar', array('size'=>50, 'maxlength'=>255)); ?>
		</td>
	</tr>
	<tr>
		<td><label>Email của bạn</label></td>
		<td>
			<?php echo $form->textField($askForm,'email', array('size'=>50, 'maxlength'=>255)); ?>
		</td>
	</tr>
	<tr>
		<td><label>Tiêu đề</label></td>
		<td>
			<?php echo $form->textField($askForm,'title', array('maxlength'=>255)); ?>
		</td>
	</tr>
	<tr>
		<td><label>Nôi dung muốn hỏi</label></td>
		<td>
			<?php echo $form->textArea($askForm,'content'); ?>
		</td>
	</tr>
	<tr>
		<td><label>Chủ đề</label></td>
		<td>
			<?php 
			$data = CHtml::listData(FrontendCategoryAskModel::model()->findAll(), 'id', 'name');
				echo $form->dropDownList($askForm, 'cat_id', $data)
			?>
		</td>
	</tr>
	<tr>
		<td><label>Mã xác thực</label></td>
		<td>
		<?php if(CCaptcha::checkRequirements()): ?>
		<div>
		<?php echo $form->textField($askForm,'verifyCode', array('style'=>'width: 120px')); ?>
		<?php $this->widget('CCaptcha'); ?>
		</div>
		<?php echo $form->error($askForm,'verifyCode'); ?>
	<?php endif; ?>
		</td>
	</tr>
	<tr>
		<td align="center" colspan="2"><?php echo CHtml::submitButton('Gửi', array('class'=>'button')); ?></td>
	</tr>	
</table>
<?php $this->endWidget(); ?>
</div>
</div>